package com.thymelef.demo;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

/**
 * @auther xm
 * @description 测试thymeleaf模板控制层
 * @date 2019/3/18
 */
//@RequestMapping("/db")
//@RestController
//@ResponseBody
@Controller
public class douBanController {

    @RequestMapping("/")
    public String index(Model model){
        model.addAttribute("placehold", "书籍、电影、音乐、小组、网站、成员");
        model.addAttribute("titlename","豆瓣");
        model.addAttribute("hotComment", "热门话题........");
        model.addAttribute("gotoConversion", "去话题广场");
        model.addAttribute("keywordsContent", "豆瓣，学习，小组讨论，广播");
//        return new ModelAndView("hello","model",model);
        return "pages/index";
    }
}
